import type { UniqueCodeOptionsDto, UniqueCodeSettingDto } from './models';
import { RestService } from '@abp/ng.core';
import { Injectable } from '@angular/core';

@Injectable({
  providedIn: 'root',
})
export class UniqueCodeSettingService {
  apiName = 'BasicArchives';
  

  get = (key: string) =>
    this.restService.request<any, UniqueCodeSettingDto>({
      method: 'GET',
      url: `/api/basic-archives/unique-code-setting/${key}`,
    },
    { apiName: this.apiName });
  

  getOptions = () =>
    this.restService.request<any, UniqueCodeOptionsDto>({
      method: 'GET',
      url: '/api/basic-archives/unique-code-setting/get-options',
    },
    { apiName: this.apiName });
  

  update = (key: string, value: UniqueCodeSettingDto) =>
    this.restService.request<any, void>({
      method: 'PUT',
      url: `/api/basic-archives/unique-code-setting/${key}`,
      body: value,
    },
    { apiName: this.apiName });

  constructor(private restService: RestService) {}
}
